{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
 <!--主要内容开始-->
<div class="content-wrapper">
    <section class="content">
        <div class="row">
            <section class="col-lg-12 connectedSortable">
                <div class="box box-default box-solid">
                    <div class="box-header with-border">
                        <span class="fa fa-paperclip" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                        <p class="box-title">按成绩分班</p>
                    </div>
                    <form action="">
                    <div class="box-body">
                        <div class="col-md-3 form-group" style="padding:0;">
                            <label class="col-sm-6 control-label text-right" style="padding:0;">
                                年级：
                            </label>
                            <div class="input-group col-md-6">
                                <select name="grade_id" class="form-control">
                                    <option value="">请选择</option>
                                    <option value="new">新生（入学成绩）</option>
                                    {%foreach from=$grade_lists item=value%}
                                    <option value="{%$value.grade_id%}">{%$value.grade_name%}</option>
                                    {%/foreach%}
                                </select>
                            </div>
                        </div>
                        <div class="col-md-5 form-group" style="padding:0;">
                            <label class="col-sm-4 control-label text-right" style="padding:0;">
                                学年学期：
                            </label>
                            <div class="input-group col-md-6 col-xs-12" style="float:left; margin-right:10px;">
                                <select name="semester_id" class="form-control">
                                    <option value="">请选择</option>
                                    {%foreach from=$semester_lists item=value%}
                                    <option value="{%$value.semester_id%}">{%$value.semester_xname%}第{%$value.semester_name%}学期</option>
                                    {%/foreach%}
                                </select>
                            </div>

                            <input type="hidden" name="a" value="classstudent.divscore">
                            <button type="submit" class="btn btn-primary"> 确 定</button>
                        </div>


                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr style="background-color:#5fb2dc;">
                                <td>班级名称</td>
                                <td>学生姓名</td>
                                <td>总分</td>
                                <td>排名</td>
                            </tr>
                            </thead>
                            {%if $first_lists%}
                            {%foreach from=$first_lists item=value%}
                            <tr>
                                <td></td>
                                <td>{%$value.student_name%}</td>
                                <td>{%$value.first_all%}</td>
                                <td>{%$value.rank%}</td>
                            </tr>
                            {%/foreach%}
                            {%/if%}
                            {%if $student_lists%}
                            {%foreach from=$student_lists key=key item=value%}
                            <tr>
                                <td>{%$value.class_name%}</td>
                                <td>{%$value.student_name%}</td>
                                <td>{%$value.all%}</td>
                                <td>{%$key+1%}</td>
                            </tr>
                            {%/foreach%}
                            {%/if%}

                        </table>
                    </div><!--box-body -->
                        <div class="box-footer" style="border-top:0px;">
                            {%$page%}
                        </div>
                    </form>
                    {%if $grade_id%}
                    <form action="">
                        {%if $grade_id eq 'new'%}
                        <div class="col-md-3 form-group" style="padding:0;">
                            <label class="col-sm-6 control-label text-right" style="padding:0;">
                                目标年级：
                            </label>
                            <div class="input-group col-md-6">
                                <select name="aim_id" class="form-control">
                                    <!--<option value="">请选择</option>-->
                                    {%foreach from=$grade_lists item=value%}
                                    <option value="{%$value.grade_id%}">{%$value.grade_name%}</option>
                                    {%/foreach%}
                                </select>
                            </div>
                        </div>
                        {%/if%}
                        <input type="hidden" name="grade_id" value="{%$grade_id%}">
                        <input type="hidden" name="semester_id" value="{%$semester_id%}">
                        <input type="hidden" name="a" value="classstudent.sdiv">
                    <div class="box-footer text-center">
                        <button class="btn btn-primary" type="submit">分班预览</button>
                    </div>

                    </form>
                    {%/if%}
                </div><!--box box-default box-solid-->
            </section>

        </div><!--row-->
    </section>
</div>
  <!--主要内容结束-->
{%include file="index.footer.tpl.php"%}
